<?php echo $this->element('banner');?>
<div class="container">
    <div id="sub-page" class="row">
        <div class="col-lg-12">
            <h2><?php echo __('News &amp; Events')?></h2>
            <div class="row home-news">
            <?php 
            foreach ($articles as $key=>$article): 
                if($key && $key % 3 == 0):
                    echo '</div>';
                    echo '<div class="row home-news">';
                endif;
            ?>
                <div class="col-lg-4">
                    <a href="/news/detail/<?php echo $article['Article']['id'];?>">
                        <img src="/files/images/<?php echo $article['Article']['image'];?>" width="362" height="154">
                    </a>
                    <a href="/news/detail/<?php echo $article['Article']['id'];?>">
                        <h4><?php echo $article['Article']['title' . $code];?></h4>
                    </a>
                    <p>
                    <?php 
                        App::uses('String', 'Utility');
                        echo String::truncate($article['Article']['short_des' . $code], 200,
                            array(
                                'ellipsis' => '[...]',
                                'exact' => false
                            )
                        );
                    ?> 
                    </p>
                </div>
            <?php endforeach;?>
            </div>    
            <?php if($this->Paginator->counter('{:pages}') > 1) :?>
            <nav>
                <div class="pagination">
                <?php
                    echo $this->Paginator->prev('&laquo; ', array('escape' => false,'tag' => 'li'), '&laquo; ', array('escape' => false, 'tag' => 'span'));
                    echo $this->Paginator->numbers(array('separator' => '', 'tag' => 'li', 'currentTag' => 'span', 'currentClass' => 'active'));
                    echo $this->Paginator->next(' &raquo;', array('tag' => 'li', 'escape' => false), ' &raquo;', array('tag' => 'span', 'escape' => false));
                ?>
                </div>
            </nav>
            <?php endif;?>
        </div>
    </div>
</div>

<?php echo $this->element('partner');?>